﻿using DGIS.Service.Enum;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DGIS.Main.Forms.Data
{
    public partial class SdeFrm : Form
    {
        public string _server;
        public string _user;
        public string _psw;
        public string _dbName;
        public SDETypeEnum _type;

        public SdeFrm()
        {
            InitializeComponent();
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            _server = this.serverTextBox.Text.Trim();
            _user = this.userTextBox.Text.Trim();
            _psw = this.pswTextBox.Text.Trim();
            _dbName = this.dbTextBox.Text.Trim();
            string type = this.typeComboBox.SelectedItem.ToString();

            switch (type)
            {
                case "Sql Server":
                    _type = SDETypeEnum.SQLServer;
                    break;
                case "Oracle":
                    _type = SDETypeEnum.Oracle;
                    break;
                case "PostgreSQL":
                    _type = SDETypeEnum.PostgreSQL;
                    break;
                default:
                    break;
            }

            this.DialogResult = DialogResult.OK;
        }
    }
}
